package com.ujiuye.dao;

import com.ujiuye.enity.User;

public class UserDao extends BaseDao<User>{
    //注册方法-->添加
    public int addUser(User u){
        String sql="insert into user(username,pwd,name,tel,bir)values(?,?,?,?,?)";
        Object[] params = {u.getUsername(),u.getPwd(),u.getName(),u.getTel(),u.getBir()};
        return update(sql,params);
    }
     public User login(String username,String pwd){
        String sql="select * from user where username=? and pwd=?  ";
        return  queryOne(sql, User.class, username,pwd);
     }
}
